<?php
if (!defined('IN_XLP')) {
    exit('Access Denied');
}
$Document = array(
    'pageid' => 'home-setting', //页面标示
    'pagename' => '基本配置', //当前页面名称
    'mycss' => array(), //加载的css样式表
    'myjs' => array(), //加载的js脚本
	'footerjs'=>array('content/fuelux/fuelux','content/combodate/moment.min','content/combodate/combodate', '../ueditor/editor_config', '../ueditor/editor.min'),
    'head' => true, //加载头部文件
);

include getTpl('header', 'public');
?>
<!--顶部导航 开始-->
<?php include getTpl('top', 'public');?>
<!--顶部导航 结束-->
<!--左侧菜单 开始-->
<?php include getTpl('nav', 'public');?>
<!--左侧菜单 结束-->
<!--主体 开始-->
<section id="content">
  <section class="main padder">
    <div class="clearfix">
      <h4><i class="fa fa-edit"></i><?php echo trim($Document['pagename'],'_');?> - <?php echo $_type_name; ?></h4>
    </div>
    <div class="row">
      <div class="col-sm-12">
        <section class="panel">
          <div class="panel-body">
            <form class="form-horizontal" method="post" id="userForm">
            <?php if($_type == 'base'){ ?>
              <div class="form-group">
                <label class="col-sm-1 control-label">还款帐号</label>
                <div class="col-sm-3">
                  <input type="text" name="repayment_account"  placeholder="" class="form-control" value="<?php echo $rs['repayment_account'] ?>" />
                  <span class="help-block">指定还款帐号</span></div>
              </div>
              <div class="form-group">
                <label class="col-sm-1 control-label">还款帐号开户行</label>
                <div class="col-sm-3">
                  <input type="text" name="account_bank"  placeholder="" class="form-control" value="<?php echo $rs['account_bank'] ?>" />
                  <span class="help-block"></span></div>
              </div>
              <div class="form-group">
                <label class="col-sm-1 control-label">还款人姓名</label>
                <div class="col-sm-3">
                  <input type="text" name="account_name"  placeholder="" class="form-control" value="<?php echo $rs['account_name'] ?>" />
                  <span class="help-block"></span></div>
              </div>
              <div class="form-group">
                <label class="col-sm-1 control-label">客服热线</label>
                <div class="col-sm-3">
                  <input type="text" name="service_hotline"  placeholder="" class="form-control" value="<?php echo $rs['service_hotline'] ?>"/>
                  <span class="help-block"></span></div>
              </div>
              <div class="form-group">
                <label class="col-sm-1 control-label">客服QQ</label>
                <div class="col-sm-3">
                  <input type="text" name="service_qq"  placeholder="" class="form-control" value="<?php echo $rs['service_qq'] ?>"/>
                  <span class="help-block"></span></div>
              </div>
              <div class="form-group">
                <label class="col-sm-1 control-label">服务时间</label>
                <div class="col-sm-3">
                  <input type="text" name="service_time"  placeholder="" class="form-control" value="<?php echo $rs['service_time'] ?>"/>
                  <span class="help-block"></span></div>
              </div>
              <div class="form-group">
                <label class="col-sm-1 control-label">借条内容</label>
                <div class="col-sm-3">
                    <input type="hidden" name="iou_content" id="iou_content">
                    <script type="text/plain"  id="editor"><?php echo htmlspecialchars_decode($rs['iou_content']); ?></script>
                </div>
            <?php } ?>
            <?php if($_type == 'ed'){  ?>
              <div class="form-group">
                <label class="col-sm-2 control-label">注册额度(单位：元)</label>
                <div class="col-sm-1">
                  <input type="text" name="stu_max_quota" class="form-control" placeholder="最高额度" value="<?php echo $rs['stu_max_quota'] ?>"/>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">平台服务费(单位：元)</label>
                <div class="col-sm-1">
                  <input type="text" name="soc_min_quota" class="form-control" placeholder="平台服务费用" value="<?php echo $rs['soc_min_quota'] ?>"/>
                </div>  
              </div> 

              <div class="form-group">
                <label class="col-sm-2 control-label">认证服务费(单位：元)</label>
                <div class="col-sm-1">
                  <input type="text" name="gold_rate" class="form-control" placeholder="认证服务费用" value="<?php echo $rs['gold_rate'] ?>"/>
                </div>  
              </div> 
            <?php } ?>  
            <?php if($_type == 'sxf'){  ?>
              <div class="form-group">
                <label class="col-sm-1 control-label">金额 <= 2000</label>
                <div class="col-sm-3">
                  <input type="text" name="handl_rate_max"  placeholder="" class="form-control" value="<?php echo $rs['handl_rate_max'] ?>" />
                  <span class="help-block">例: 3 = 3%</span></div>
              </div>
              <div class="form-group">
                <label class="col-sm-1 control-label">2000<金额<=5000</label>
                <div class="col-sm-3">
                  <input type="text" name="handl_rate_mid"  placeholder="" class="form-control" value="<?php echo $rs['handl_rate_mid'] ?>"/>
                  <span class="help-block">例: 2.5 = 2.5%</span></div>
              </div>
              <div class="form-group">
                <label class="col-sm-1 control-label">借贷金额 > 5000</label>
                <div class="col-sm-3">
                  <input type="text" name="handl_rate_min"  placeholder="" class="form-control" value="<?php echo $rs['handl_rate_min'] ?>"/>
                  <span class="help-block">例: 2 = 2%</span></div>
              </div>
            <?php } ?>
            <?php if($_type == 'll'){  ?>    
              <div class="form-group">
                <label class="col-sm-1 control-label">普通会员</label>
                <div class="col-sm-3">
                  <input type="text" name="common_rate" class="form-control" value="<?php echo $rs['common_rate'] ?>"/>
                  <span class="help-block">普通会员日利率 例：0.9 = 0.9%</span></div>
              </div>
              <div class="form-group">
                <label class="col-sm-1 control-label">黄金会员</label>
                <div class="col-sm-3">
                  <input type="text" name="gold_rate" class="form-control" value="<?php echo $rs['gold_rate'] ?>"/>
                  <span class="help-block">黄金会员日利率 例：0.7 = 0.7%</span></div>
              </div>
              <div class="form-group">
                <label class="col-sm-1 control-label">逾期日利率</label>
                <div class="col-sm-3">
                  <input type="text" name="over_rate" class="form-control" value="<?php echo $rs['over_rate'] ?>"/>
                  <span class="help-block">超出还款日后的每日利率</span></div>
              </div>
              <?php } ?>
              <?php if($_type == 'jf'){  ?>
              <div class="form-group">
                <label class="col-sm-1 control-label">推广积分</label>
                <div class="col-sm-3">
                  <input type="text" name="market_credit" class="form-control" value="<?php echo $rs['market_credit'] ?>"/>
                  <span class="help-block">发展一个下线会员所获得的佣金积分</span></div>
              </div>
              <div class="form-group">
                <label class="col-sm-1 control-label">借款积分</label>
                <div class="col-sm-3">
                  <input type="text" name="borrow_credit" class="form-control" value="<?php echo $rs['borrow_credit'] ?>"/>
                  <span class="help-block">下线会员成功申请到一笔借款所获得的佣金积分</span></div>
              </div>
              <div class="form-group">
                <label class="col-sm-1 control-label">还款积分</label>
                <div class="col-sm-3">
                  <input type="text" name="pay_off_credit" class="form-control" value="<?php echo $rs['pay_off_credit'] ?>"/>
                  <span class="help-block">下线会员成功还清一笔借款所获得的佣金积分</span></div>
              </div>
              <div class="form-group">
                <label class="col-sm-1 control-label">升级条件积分</label>
                <div class="col-sm-3">
                  <input type="text" name="up_credit" class="form-control" value="<?php echo $rs['up_credit'] ?>"/>
                  <span class="help-block">普通会员升级为黄金会员所需的信用积分</span></div>
              </div>
              <div class="form-group">
                <label class="col-sm-1 control-label">信用积分比</label>
                <div class="col-sm-3">
                  <input type="text" name="esteem_credit_rate" class="form-control" value="<?php echo $rs['esteem_credit_rate'] ?>"/>
                  <span class="help-block">每借一百元会员可获得的信用积分</span></div>
              </div>
              <div class="form-group">
                <label class="col-sm-1 control-label">佣金积分比</label>
                <div class="col-sm-3">
                  <input type="text" name="credit_rate" class="form-control" value="<?php echo $rs['credit_rate'] ?>"/>
                  <span class="help-block">每100佣金积分可提现的金额</span></div>
              </div>
              <div class="form-group">
                <label class="col-sm-1 control-label">最低提现额度</label>
                <div class="col-sm-3">
                  <input type="text" name="cash_min" class="form-control" value="<?php echo $rs['cash_min'] ?>"/>
                  <span class="help-block">会员佣金提现的最低额度</span></div>
              </div>
              <?php } ?>
              <div class="form-group">
                  <div class="col-sm-9 col-lg-offset-1">
                    <div class="col-sm-1"><button type="submit" id="sub-ok" data-loading-text="正在提交..." class="btn btn-primary">保存</button></div>
                    <div class="col-md-offset-2"><button type="button" class="btn btn-white">取消</button></div>
                  </div>
               </div>
            </form>
          </div>
        </section>
      </div>
    </div>
  </section>
</section>
<!--主体 结束--> 
<script>
var fixedImagePath      = '';
var uploadUrl           = "<?php echo U('goods/upload');?>";
var UEDITOR_HOME_URL = '<?php echo LOCAL_PUBLIC_PATH; ?>ueditor/';
$(function(){
<?php if($_type == 'base'){   ?>
  var msg_editor = new UE.ui.Editor({initialFrameWidth: 690, initialFrameHeight:320});
  msg_editor.render("editor");
<?php } ?>
	$('#userForm').submit(function(){
    // $("#iou_content").val(msg_editor.getContent());
		Msg.loading();
		  $.post('<?php echo U('home/settingsave');?>',$(this).serialize(),function(result){
			  Msg.hide();
			  resetSubmit("#sub-ok",'保存');
			  if (result.status==1){
  				Msg.ok(result.info);  
  			}else{
  				Msg.error(result.info);
  			}
		  },'json');
		  return false;
	})	
})
</script>
<?php
include getTpl('footer', 'public');
?>
